import MyIcon from '@/components/myIcon'
import React, { useState } from 'react';
import { Search, Toast } from 'react-vant';
import s from './style.module.less'
import { useNavigate } from 'react-router-dom'

export default () => {

  const navigate = useNavigate()

  const goToMap = () => {   // 跳转地图页面
    navigate('/map')
  }
  const goToSearch = () => {  // 跳转搜索页面
    navigate('/search')
    console.log(1);
  }
  return (
    <div className='main'>
      <Search
        onClickInput={() => goToSearch()}
        showAction
        label="北京"
        actionText={<div onClick={() => goToMap()}>
          <div className={s.map} >
            <MyIcon name='icon-ditu' style={{ fontSize: 25, }} />
          </div>
        </div>}
        placeholder="请输入小区/楼盘/地点"
      />
    </div>
  );
};